

#include <stdio.h>
 
int main()
{
  int array[10], n, i, j, swap;
 
  printf("Enter  the number of elements\n");
  scanf("%d", &n);
 
  printf("Enter %d integers\n", n);
 
  for (i = 0; i < n; i++)
    scanf("%d", &array[i]);
  for (i = 1 ; i <  n ; i++)
  {
    for (j = i ; j >= 1; j--)
    {
{
      if (array[j] < array[j-1])
      {
        swap       = array[j];
        array[j]   = array[j-1];
        array[j-1] = swap;
      }}
    }
  }
 
  printf("Sorted list in ascending order:\n");
 
  for (int c = 0 ; c < n ; c++ )
     printf("%d\n", array[c]);
 
  return 0;
}


